#include <dlfcn.h>
#include <stdio.h>

__attribute__((visibility("default")))
int dlsym_user(void) {
    void *h = dlopen(NULL, RTLD_NOW);
    if (!h) {
        return -1;
    }

    const char *s1 = "printf";
    const char *s2 = "puts";

    void *p1 = dlsym(h, s1);
    void *p2 = dlsym(h, s2);

    if (p1 && p2) {
        return 0;
    }
    return -2;
}

